package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.enumeration.OperationType;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface CategoryMapper {


    Page<Category> pageQuery(CategoryPageQueryDTO categoryPageQueryDTO);

    void saveOne(Category category);


    @Delete("delete from category  where id=#{id}")
    void deleteById(Long id);

    void update(Category category);

    //@Select("select * from category where type=#{type}")
    List<Category> selectByType(Integer type);


    //--分类id查
    @Select("select * from category  where id=#{id} ")
    Category selectById(Long id);
}
